package com.itheima.client;


import com.itheima.client.fallback.UserClientFallBack;
import com.itheima.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


//Feign客户端 申明当前类为Feign,指定服务名为 user-service
@FeignClient(value="user-service",fallback = UserClientFallBack.class)
public interface UserClient {

    //自动拼接url
    @GetMapping("/user/{id}")
    User queryById(@PathVariable Long id);
}
